this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,i=t[0],s=t[1],l=t[2],u=0,b=[];u<i.length;u++)a=i[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,i=1;i<r.length;i++){var s=r[i];0!==n[s]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={7:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=o,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var d=s;return c.push([437,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.wp.compose},124:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var o=r(0),n=r(1),c=r(5),a=r(3),i=r(2);const s=(e,t,r)=>Object(o.createElement)(c.BlockControls,null,Object(o.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),c=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Product rating","woocommerce"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Reviewer name","woocommerce"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Image","woocommerce"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review date","woocommerce"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review content","woocommerce"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woocommerce"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woocommerce")}),Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woocommerce")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Order by","woocommerce"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(i.SelectControl,{label:Object(n.__)("Order Product Reviews by","woocommerce"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woocommerce"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Load more","woocommerce"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Load More Reviews","woocommerce"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},131:function(e,t){},137:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),a=r(29),i=r(11);r(188),t.a=Object(i.withInstanceId)((({className:e,instanceId:t,label:r="",onChange:n,options:i,screenReaderLabel:s,value:l=""})=>{const d=`wc-block-components-sort-select__select-${t}`;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",e)},Object(o.createElement)(a.a,{label:r,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(o.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:n,value:l},i&&i.map((e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label)))))}))},14:function(e,t){e.exports=window.wp.apiFetch},143:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(17);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woocommerce"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(o.__)("Alice","woocommerce"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:n.p.defaultAvatar,96:n.p.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woocommerce"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(o.__)("Bob","woocommerce"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:n.p.defaultAvatar,96:n.p.defaultAvatar},rating:null,verified:!1}]}}},168:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},169:function(e,t,r){"use strict";var o=r(0),n=r(5),c=(r(189),r(67));t.a=({attributes:e})=>Object(o.createElement)("div",{...n.useBlockProps.save({className:Object(c.a)(e)}),...Object(c.b)(e)})},17:function(e,t,r){"use strict";r.d(t,"p",(function(){return c})),r.d(t,"n",(function(){return a})),r.d(t,"m",(function(){return i})),r.d(t,"o",(function(){return s})),r.d(t,"k",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"h",(function(){return u})),r.d(t,"l",(function(){return b})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return m})),r.d(t,"g",(function(){return p})),r.d(t,"a",(function(){return h})),r.d(t,"b",(function(){return O})),r.d(t,"i",(function(){return _})),r.d(t,"j",(function(){return j})),r.d(t,"f",(function(){return f}));var o,n=r(3);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=(n.STORE_PAGES.checkout.permalink,n.STORE_PAGES.privacy.permalink),b=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),w=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,p=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("localPickupEnabled",!1)),g=Object(n.getSetting)("countries",{}),v=Object(n.getSetting)("countryData",{}),h=Object.fromEntries(Object.keys(v).filter((e=>!0===v[e].allowBilling)).map((e=>[e,g[e]||""]))),O=Object.fromEntries(Object.keys(v).filter((e=>!0===v[e].allowBilling)).map((e=>[e,v[e].states||[]]))),_=Object.fromEntries(Object.keys(v).filter((e=>!0===v[e].allowShipping)).map((e=>[e,g[e]||""]))),j=Object.fromEntries(Object.keys(v).filter((e=>!0===v[e].allowShipping)).map((e=>[e,v[e].states||[]]))),f=Object.fromEntries(Object.keys(v).map((e=>[e,v[e].locale||[]])))},175:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(289),a=r(2),i=r(5),s=r(3),l=r(88),d=r(29);r(223);var u=({onClick:e,label:t=Object(n.__)("Load more","woocommerce"),screenReaderLabel:r=Object(n.__)("Load more","woocommerce")})=>Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:e},Object(o.createElement)(d.a,{label:t,screenReaderLabel:r}))),b=r(137);r(220);var w=({onChange:e,readOnly:t,value:r})=>Object(o.createElement)(b.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woocommerce"),onChange:e,options:[{key:"most-recent",label:Object(n.__)("Most recent","woocommerce")},{key:"highest-rating",label:Object(n.__)("Highest rating","woocommerce")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woocommerce")}],readOnly:t,screenReaderLabel:Object(n.__)("Order reviews by","woocommerce"),value:r}),m=r(4),p=r.n(m),g=r(18),v=r.n(g),h=r(208),O=r.n(h);const _=(e,t,r="...")=>O()(e,{suffix:r,limit:t}).html,j=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),f=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=_(e,o.middle),o=j(o,t.clientHeight,r);return o.middle})(e,t,r);return _(e,n-o.length,o)},k={className:"read-more-content",ellipsis:"&hellip;",lessText:Object(n.__)("Read less","woocommerce"),maxLines:3,moreText:Object(n.__)("Read more","woocommerce")};class y extends o.Component{constructor(e){super(e),v()(this,"reviewSummary",void 0),v()(this,"reviewContent",void 0),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(o.createRef)(),this.reviewSummary=Object(o.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:f(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}v()(y,"defaultProps",k);var R=y;r(222);var E=({attributes:e,review:t={}})=>{const{imageType:r,showReviewDate:c,showReviewerName:a,showReviewImage:i,showReviewRating:s,showReviewContent:l,showProductName:d}=e,{rating:u}=t,b=!(Object.keys(t).length>0),w=Number.isFinite(u)&&s;return Object(o.createElement)("li",{className:p()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":b,"wc-block-components-review-list-item__item--has-image":i}),"aria-hidden":b},(d||c||a||i||w)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},i&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woocommerce")},Object(n.__)("Verified buyer","woocommerce")))}(t,r,b),(d||a||w||c)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},w&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)(/* translators: %f is referring to the average rating value */
Object(n.__)("Rated %f out of 5","woocommerce"),t),a={__html:Object(n.sprintf)(/* translators: %s is referring to the average rating value */
Object(n.__)("Rated %s out of 5","woocommerce"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(t),d&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(t),a&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(t),c&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(t))),l&&function(e){return Object(o.createElement)(R,{maxLines:10,moreText:Object(n.__)("Read full review","woocommerce"),lessText:Object(n.__)("Hide full review","woocommerce"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(t))};r(221);var S=({attributes:e,reviews:t})=>{const r=Object(s.getSetting)("showAvatars",!0),n=Object(s.getSetting)("reviewRatingsEnabled",!0),c=(r||"product"===e.imageType)&&e.showReviewImage,a=n&&e.showReviewRating,i={...e,showReviewImage:c,showReviewRating:a};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===t.length?Object(o.createElement)(E,{attributes:i}):t.map(((e,t)=>Object(o.createElement)(E,{key:e.id||t,attributes:i,review:e}))))},T=r(25),C=r.n(T),P=r(67),N=r(28);class L extends o.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:i,totalReviews:d}=this.props;if(t)return Object(o.createElement)(l.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===i.length&&!r)return Object(o.createElement)(c,{attributes:e});const b=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&b&&Object(o.createElement)(w,{readOnly:!0,value:e.orderby,onChange:()=>null}),Object(o.createElement)(S,{attributes:e,reviews:i}),e.showLoadMore&&d>i.length&&Object(o.createElement)(u,{screenReaderLabel:Object(n.__)("Load more reviews","woocommerce")}))}}var x=(e=>{class t extends o.Component{constructor(...e){super(...e),v()(this,"isPreview",!!this.props.attributes.previewReviews),v()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),v()(this,"isMounted",!1),v()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),v()(this,"setError",(async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(N.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)}))}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!C()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};if(t){const e=Array.isArray(t)?t:JSON.parse(t);a.category_id=Array.isArray(e)?e.join(","):e}return n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(e=[]){const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(P.c)(this.getArgs(e.length)).then((({reviews:t,totalReviews:r})=>(this.isMounted&&this.setState({reviews:e.filter((e=>Object.keys(e).length)).concat(t),totalReviews:r,loading:!1,error:null}),{newReviews:t}))).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,{...this.props,error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a})}}v()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(L);t.a=({attributes:e,icon:t,name:r,noReviewsPlaceholder:s})=>{const{categoryIds:l,productId:d,reviewsOnPageLoad:u,showProductName:b,showReviewDate:w,showReviewerName:m,showReviewContent:p,showReviewImage:g,showReviewRating:v}=e,{order:h,orderby:O}=Object(P.d)(e.orderby),_=!(p||v||w||m||g||b),j=Object(i.useBlockProps)({className:Object(P.a)(e)});return _?Object(o.createElement)(a.Placeholder,{icon:t,label:r},Object(n.__)("The content for this block is hidden due to block settings.","woocommerce")):Object(o.createElement)("div",{...j},Object(o.createElement)(x,{attributes:e,categoryIds:l,delayFunction:e=>Object(c.a)(e,400),noReviewsPlaceholder:s,orderby:O,order:h,productId:d,reviewsToDisplay:u}))}},188:function(e,t){},189:function(e,t){},2:function(e,t){e.exports=window.wp.components},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}}},289:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));const o=(e,t,r)=>{let o,n=null;const c=(...c)=>{n=c,o&&clearTimeout(o),o=setTimeout((()=>{o=null,!r&&n&&e(...n)}),t),r&&!o&&e(...c)};return c.flush=()=>{o&&n&&(e(...n),clearTimeout(o),o=null)},c}},29:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=({label:e,screenReaderLabel:t,wrapperElement:r,wrapperProps:n={}})=>{let a;const i=null!=e,s=null!=t;return!i&&s?(a=r||"span",n={...n,className:c()(n.className,"screen-reader-text")},Object(o.createElement)(a,{...n},t)):(a=r||o.Fragment,i&&s&&e!==t?Object(o.createElement)(a,{...n},Object(o.createElement)("span",{"aria-hidden":"true"},e),Object(o.createElement)("span",{className:"screen-reader-text"},t)):Object(o.createElement)(a,{...n},e))}},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.wp.escapeHtml},34:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(31);t.a=({error:e})=>Object(o.createElement)("div",{className:"wc-block-error-message"},(({message:e,type:t})=>e?"general"===t?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(e))):"api"===t?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(e))):e:Object(n.__)("An error has prevented the block from being updated.","woocommerce"))(e))},437:function(e,t,r){e.exports=r(580)},5:function(e,t){e.exports=window.wp.blockEditor},580:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(7),a=r(70),i=r(627),s=(r(189),r(5)),l=r(2),d=r(175),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woocommerce")},Object(n.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woocommerce")),b=r(124),w=({attributes:e,setAttributes:t})=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woocommerce")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woocommerce"),checked:e.showProductName,onChange:()=>t({showProductName:!e.showProductName})}),Object(b.b)(e,t)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woocommerce")},Object(b.c)(e,t))),Object(o.createElement)(d.a,{attributes:e,icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woocommerce"),noReviewsPlaceholder:u})),m=r(168),p=r(169),g=r(143);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woocommerce"),icon:{src:Object(o.createElement)(a.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woocommerce")],description:Object(n.__)("Show a list of all product reviews.","woocommerce"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...g.a,attributes:{...g.a.attributes,showProductName:!0}},attributes:{...m.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>"woocommerce_recent_reviews"===e&&!(null==t||!t.raw),transform:({instance:e})=>Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:e.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}]},edit:e=>{const t=Object(s.useBlockProps)();return Object(o.createElement)("div",{...t},Object(o.createElement)(w,{...e}))},save:p.a})},67:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(14),n=r.n(o),c=r(4),a=r.n(c),i=r(3);const s=e=>{if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map((e=>e.join("="))).join("&"),parse:!1}).then((e=>e.json().then((t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:i,showProductName:s,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":i,"has-product-name":s})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:i,showOrderby:s}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":i,"data-show-orderby":s};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},7:function(e,t){e.exports=window.wp.blocks},88:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(70),a=r(212),i=r(4),s=r.n(i),l=r(2),d=r(34);r(131),t.a=({className:e,error:t,isLoading:r=!1,onRetry:i})=>Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woocommerce"),className:s()("wc-block-api-error",e)},Object(o.createElement)(d.a,{error:t}),i&&Object(o.createElement)(o.Fragment,null,r?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:i},Object(n.__)("Retry","woocommerce"))))},9:function(e,t){e.exports=window.wp.primitives}});